home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
tpgrwndw.zip
/
DEMOWNDW.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-01-04
|
1KB
|
48 lines
(* A graphics Window unit designed for the Adventure System *)
Program WndwDemo;
uses Windows,Graph,Crt;
var
CursorPrompt : string;
GrDriver,
GrMode : integer;
ch : char;
testSt : string;
x,y : integer;
lcv : byte;
Begin
CursorPrompt := '';
CursorPrompt := 'Enter Text';
grDriver := Detect;
InitGraph(grDriver,grMode,'');
if GrDriver = VGA then
SetGraphMode(VGAMed)
else if grDriver = EGA then
SetGraphMode(EGAHI);
ShowWndw(CursorWndw(CursorPrompt)); (* ShowWndw will close itself *)
ShowWndw('Hello There. Once upon a time there was an evil ogre. He lived'+
' in a fortress and stole a beautiful maiden who he wished to wed.');
for lcv := 1 to 7 do
begin
x := Random(60)+2;
y := Random(30)+2;
Str(lcv,testSt);
testSt := 'This is window #'+testSt+'!'+#13+'Check it out!'+
#13+'You can have up to 7'+#13+'windows at a time!'+#13;
Case Random(4)+1 of
1 : TestSt := TestSt + 'Wild!';
2 : TestSt := TestSt + 'Funcky!';
3 : TestSt := TestSt + 'Awesome!';
4 : TestSt := TestSt + 'Really cool!';
end;
OpenWndw(testSt,x,y,x+20,y+4);
ClearText; (* Since no close window, must clear window text buffer *)
end;
for lcv := 1 to 7 do
begin
ch := ReadKey;
CloseWndw;
end;
CloseGraph;
End.